package com.shop.record.service;

import com.github.pagehelper.PageHelper;
import com.shop.record.dao.t_storage_recordMapper;
import com.shop.record.pojo.t_storage_record;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @PackgeName: com.shop.record.service
 * @ClassName: t_storage_recordServiceimpl
 * @Author: 比巴卜
 * Date: 2021/7/23 10:18
 * project name: shop
 * @Version: 1.8
 * @Description:
 */
@Service
public class t_storage_record_Serviceimpl implements t_storage_record_Service {
    @Autowired
    private t_storage_recordMapper mapper;

    public t_storage_record_Serviceimpl() {

    }

    public t_storage_record_Serviceimpl(t_storage_recordMapper mapper) {
        this.mapper = mapper;
    }

    /**
     * 分页模糊查询
     *
     * @param pageNum   分页起始下标
     * @param goodsName
     * @param goodsDesc
     * @param goodsUnit
     * @return
     */
    @Override
    public List<t_storage_record> Select(Integer pageNum, String goodsName, String goodsDesc, String goodsUnit) {
        Integer pageSize = 4;
        PageHelper.startPage(pageNum, pageSize);
        List<t_storage_record> select = mapper.Select(goodsName, goodsDesc, goodsUnit);
        return select;
    }

    @Override
    public int Insert(t_storage_record record) {
        return mapper.Insert(record);
    }

    @Override
    public int Update(t_storage_record record) {
        return mapper.Update(record);
    }

    @Override
    public int Delete(Integer id) {
        return mapper.Delete(id);
    }
}
